#pragma once

#pragma unmanaged

#include <BWSAL\TaskState.h>

#pragma managed

#include "..\BWAPI\IIdentifiedObject.h"
#include "Enum\TaskStateType.h"

using namespace System;
using namespace System::Collections::Generic;

namespace BroodWar
{
	namespace Addon
	{
		public ref class TaskState : public Api::IIdentifiedObject
		{
		internal:
			bool dispose;
			BWSAL::TaskState* instance;

			TaskState(BWSAL::TaskState state);
			TaskState(BWSAL::TaskState* state);
			~TaskState();
			!TaskState();
		public:
			TaskState();
			TaskState(int id);

			virtual property int Id { int get(); }
			property TaskStateType Type { TaskStateType get(); }
			bool TypeEquals(TaskStateType buildType);
			
			property bool IsWaiting { bool get(); }
			property bool IsRunning { bool get(); }
			property bool IsCompleted { bool get(); }

			virtual int GetHashCode() override;
			virtual bool Equals(Object^ o) override;
			virtual String^ ToString() override;
			bool Equals(TaskState^ other);

			static property HashSet<TaskState^>^ AllTaskStates { HashSet<TaskState^>^ get(); }

			static bool operator == (TaskState^ first, TaskState^ second);
			static bool operator != (TaskState^ first, TaskState^ second);
		};

		TaskState^ ConvertTaskState(BWSAL::TaskState state);
		BWSAL::TaskState ConvertTaskState(TaskState^ state);
	}
}
